import Phaser from 'phaser'
//导入4个scenes场景
import Loading from '@/scenes/Loading'
import Menu from '@/scenes/Menu'
import Main from '@/scenes/Main'
import constants from '@/obfuscator/constants'

const config = {
  type: Phaser.AUTO,
  width: 480,
  height: 320,
  physics: {
    default: 'arcade',
    arcade: {
      debug: process.env.EXT_DEBUG_MODE,
      gravity: { y: 0 }
    }
  },
  scene: [Loading]
}

const game = new Phaser.Game(config)

game.scene.add('menu', Menu)
game.scene.add('main', Main)

game.global = {
  constants
}

export default game
